<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>监管单位--启动遴选</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/templates/act/process-xl.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style>
        body {
            box-sizing: border-box;
            -moz-box-sizing: border-box; /* Firefox */
            -webkit-box-sizing: border-box; /* Safari */
            padding: 30px 30px;
        }

        p {
            text-indent: 25px
        }

        .title1, .title2 {
            display: inline;

        }

        .title2 {
            position: relative;
            right: -45%;
        }

        h4 {
            display: inline;
        }

        .layui-table th, table {
            text-align: center;
        }

        .hide {
            display: none;
        }
    </style>
</head>
<body>
<div class="title1">
    <h4 style="font-weight: bold;">项目名称:</h4>
    <h4 id="prjName"></h4>
</div>
<div class="title2">
    <h4 style="font-weight: bold;">费用范围:</h4>
    <h4 id="fanwei"></h4>
</div>
<div style="margin-top: 15px">
    <h4 style="font-weight: bold;">遴选第1批次流程</h4>
</div>
<div>
    <img style="width: 80%; margin: 20px 60px;" src="linxuan.png">
</div>
<div style="margin-top: 15px">
    <h4 style="font-weight: bold;">审查费用与审查时限</h4>
</div>
<form class="layui-form searchForm" id="form" action="" lay-filter="example">
    <input type="hidden" name="prjId" class="prjId formData" value="">
    <input type="hidden" name="decId" class="decId formData" value="">
    <input type="hidden" name="taskId" class="taskId formData" value="">
    <table class="layui-table" lay-filter="example">
        <colgroup>
            <col>
            <col>
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>费用项</th>
            <th>审查费用（元）</th>
            <th>审查时限（天）</th>
        </tr>
        </thead>
        <tbody>
        <tr class="sj hide">
            <td>施工图</td>
            <td>
                <input type="text" name="SjCost" lay-verify="isEmpty" autocomplete="off" class="layui-input formData">

            </td>
            <td>
                <input type="text" name="sjDay" lay-verify="isEmpty" autocomplete="off" class="layui-input formData">
            </td>
        </tr>
        <tr class="kc hide">
            <td>勘察报告</td>
            <td>
                <input type="text" name="KcCost" lay-verify="isEmpty" autocomplete="off" class="layui-input formData">
            </td>
            <td>
                <input type="text" name="kcDay" lay-verify="isEmpty" autocomplete="off" class="layui-input formData">
            </td>
        </tr>
        </tbody>
    </table>
    <button lay-submit lay-filter="submit" style="display: none;" id="submit" class="demo1">提交</button>
</form>
<!--
<p style="color: red;">当上次没有机构报价时，可再次启动遴选，即第二批次遴选。</p>
-->
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    var configureCom = {};
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'table', 'matchDict', 'table'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var table = layui.table;
        var matchDict = layui.matchDict;
        var configureCom = layui.configureCom;
        window.$ = layui.jquery;
        var sessionFun = layui.sessionFun;//存储session
        var listData = sessionFun.get(configure.SESSION_PROJECT_WAIT_LIST_DATA);
        var arr = listData.submitExamInfo.split(',');
        if (arr.length == 2) {
            $('#fanwei').html(matchDict.name(arr[0], configure.SUBMIT_EXAM_INFO) + '、' + matchDict.name(arr[1], configure.SUBMIT_EXAM_INFO));
        } else {
            $('#fanwei').html(matchDict.name(arr[0], configure.SUBMIT_EXAM_INFO));
        }
        if (listData.submitExamInfo.indexOf('1') > -1) {//勘察
            $('.kc').removeClass('hide');
        }
        if (listData.submitExamInfo.indexOf('2') > -1 || listData.submitExamInfo.indexOf('3') > -1) {//设计
            $('.sj').removeClass('hide');
        }
        if (listData.submitExamInfo.indexOf('1') > -1 && listData.submitExamInfo.indexOf('2') > -1 || listData.submitExamInfo.indexOf('3') > -1) {
            $('.sj').removeClass('hide');
            $('.kc').removeClass('hide');
        }

        var prjData = {
            prjId: listData.prjId,
            decId: listData.decId,
            taskId: listData.taskId
        };
        form.val('example', prjData);
        $.each(listData, function (index, value) {
            $('#' + index).html(value)
        });


        //监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });

    });

    function getData() {
        return new Promise(function (res, rej) {
            var data = {};
            if (!window.formVerifyFun()) {
                return false;
            }
            $('.formData').each(function (index, item) {
                var key = $(item).attr('name');
                data[key] = $(item).val();
            });
            res({result: data});
        });
    }
</script>
</body>
</html>